//
//  WHStatusViewView.m
//  RunningMan
//
//  Created by dllo on 16/5/27.
//  Copyright © 2016年 JohnnyB. All rights reserved.
//

#define MAS_SHORTHAND
#define MAS_SHORTHAND_GLOBALS

#import "WHStatusViewView.h"
#import "Header.h"
#import "MZTimerLabel.h"
@interface WHStatusViewView ()

@end

@implementation WHStatusViewView

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.navigationController.navigationBar.translucent = NO;
//    self.view.backgroundColor = [UIColor blueColor];
    [self initStatusView];
    
}

-(void)initStatusView{
    
    /*** 全程公里数 **/
    self.distance = [UILabel new];
    [self.view addSubview:self.distance];
    [self.distance makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.offset(20);
        make.left.offset(30);
        make.right.offset(-SCREEN_WIDTH / 2 + 50);
        make.height.offset(40);
        
    }];
    
    self.distance.textAlignment = NSTextAlignmentCenter;
//    self.distance.backgroundColor = [UIColor redColor];
    self.distance.text = @"00.00";
    self.distance.font = [UIFont systemFontOfSize:40 weight:0.5];
    self.distance.adjustsFontSizeToFitWidth = YES;
    
    /** 总距离的单位**/
    self.distanceUnit = [UILabel new];
    [self.view addSubview:self.distanceUnit];
    [self.distanceUnit makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.offset(30);
        make.height.offset(20);
        make.left.equalTo(self.distance.right).with.offset(10);
        make.right.offset(-5);
        
    }];
    
    self.distanceUnit.textAlignment = NSTextAlignmentCenter;
//    self.distanceUnit.backgroundColor = [UIColor greenColor];
    self.distanceUnit.text = @"全程距离：公里";
    self.distanceUnit.adjustsFontSizeToFitWidth = YES;
    
    /** 倒计时 **/
    self.timerLabel = [MZTimerLabel new];
    [self.view addSubview:self.timerLabel];
    [self.timerLabel makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.distance.bottom).with.offset(20);
        make.height.offset(30);
        make.left.offset(100);
        make.right.offset(-100);
        
    }];
    
    self.timerLabel.textAlignment = NSTextAlignmentCenter;
//    self.timerLabel.backgroundColor = [UIColor blueColor];
    self.timerLabel.text = @"00：00：00";
    self.timerLabel.adjustsFontSizeToFitWidth = YES;
    self.timerLabel.font = [UIFont systemFontOfSize:30 weight:0.3];
    
    /** 速度 **/
    self.speedLabelKM = [UILabel new];
    [self.view addSubview:self.speedLabelKM];
    [self.speedLabelKM makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.timerLabel.bottom).with.offset(15);
        make.left.offset(20);
        make.right.offset( - SCREEN_WIDTH/2);
        make.height.offset(30);
        
    }];
    
    self.speedLabelKM.textAlignment = NSTextAlignmentCenter;
//    self.speedLabelKM.backgroundColor = [UIColor purpleColor];
    self.speedLabelKM.text = @"00.00";
    self.speedLabelKM.adjustsFontSizeToFitWidth = YES;
    
    /** 速度单位 **/
    self.speedLabelKMUnit = [UILabel new];
    [self.view addSubview:self.speedLabelKMUnit];
    [self.speedLabelKMUnit makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.speedLabelKM.bottom).with.offset(10);
        make.left.offset(20);
        make.right.offset( - SCREEN_WIDTH/2);
        make.height.offset(20);
        
    }];
    self.speedLabelKMUnit.textAlignment = NSTextAlignmentCenter;
//    self.speedLabelKMUnit.backgroundColor = [UIColor orangeColor];
    self.speedLabelKMUnit.text = @"配速：千米每小时";
    
    /** 移动速度 **/
    self.moveSpeedLabel = [UILabel new];
    [self.view addSubview:self.moveSpeedLabel];
    [self.moveSpeedLabel makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.timerLabel.bottom).with.offset(15);
        make.left.equalTo(self.speedLabelKM.right).with.offset(20);
        make.right.offset(-20);
        make.height.offset(30);
        
    }];
    
    self.moveSpeedLabel.textAlignment = NSTextAlignmentCenter;
//    self.moveSpeedLabel.backgroundColor = [UIColor yellowColor];
    self.moveSpeedLabel.text = @"00.00";
    
    /** 移动速度单位 **/
    self.moveSpeedLabelUnit = [UILabel new];
    [self.view addSubview:self.moveSpeedLabelUnit];
    [self.moveSpeedLabelUnit makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.moveSpeedLabel.bottom).with.offset(10);
        make.left.equalTo(self.speedLabelKMUnit.right).with.offset(20);
        make.right.offset(-20);
        make.height.offset(20);
        
    }];
    
    self.moveSpeedLabelUnit.textAlignment = NSTextAlignmentCenter;
//    self.moveSpeedLabelUnit.backgroundColor = [UIColor magentaColor];
    self.moveSpeedLabelUnit.text = @"配速：米每秒";
    self.moveSpeedLabelUnit.adjustsFontSizeToFitWidth = YES;
    
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
